home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 9 / applic / drecker.bas < prev    next >
Encoding:
BASIC Source File  |  1986-04-17  |  5.3 KB  |  134 lines

  1. 10    FULLW 2
  2. 20    CLEARW 2: PRINT "FINANCIAL PACKAGE"
  3. 30    PRINT "copyright (c) 1985"
  4. 40    PRINT "Dr. Michael W. Ecker"
  5. 50    PRINT "Recreational Mathemagical Software"
  6. 60    PRINT "129 Carol Drive"
  7. 70    PRINT "Clarks Summit, PA  18411"
  8. 80    PRINT: INPUT "     --more--    "; x$
  9. 85    clearw 2
  10. 90    PRINT "(This program appears in the February, 1986 issue of Computer"
  11. 100   PRINT "Shopper. It was written for the TRS-80 Model 100, but needed"
  12. 110   PRINT "only very minor changes for it to run on the ST. If you're"
  13. 120   PRINT "wondering, as I was, what the heck annuities are, the book"
  14. 130   print "'How to Buy Stocks' has this to say, 'A wide variety of"
  15. 135   print "annuities, some of them tax sheltered, are available from"
  16. 140   print "the various fund families, brokerage houses, and insurance"
  17. 145   print "companies. These are self-imposed long-term savings programs"
  18. 150   print "with no maximum limits on their contributions.')"
  19. 155   print "                               --Wade LaPan"
  20. 170   PRINT:INPUT "    --more--    ";X$
  21. 180   CLEARW 2
  22. 190   PRINT "MENU OF PROGRAMS"
  23. 200   PRINT "================"
  24. 210   PRINT "1) COMPOUND INTEREST"
  25. 220   PRINT "2) ANNUITY PLANNING"
  26. 230   PRINT "3) LOAN AMORTIZATION"
  27. 240   PRINT "4) QUIT PROGRAM"
  28. 250   PRINT
  29. 260   INPUT "CHOICE NUMBER (1,2,3,4)";N
  30. 270   IF N = 4 THEN END
  31. 280   IF N<>1 AND N<>2 AND N<>3 THEN 260
  32. 290   CLEARW 2: ON N GOSUB 310,550,1100
  33. 300   CLEARW 2: GOTO 180
  34. 310   PRINT "===COMPOUND INTEREST CALCULATION==="
  35. 320   print "==================================="
  36. 330   PRINT "I'll ask you the amount you wish to"
  37. 340   PRINT "deposit (one deposit only) followed"
  38. 350   PRINT "by the interest rate (percent) and the"
  39. 360   PRINT "term in years, as well as the number"
  40. 370   PRINT "of times per year interest is given"
  41. 375   PRINT "(i.e., how many times per year it is compounded)."
  42. 380   PRINT: INPUT "Enter to continue";X$
  43. 390   CLEARW 2
  44. 400   INPUT "Principal (no dollar sign)";P
  45. 410   IF P<0 THEN 400
  46. 420   INPUT "Annual interest rate (percent)";I:R=I/100
  47. 430   IF I<0 THEN 420
  48. 440   INPUT "Time (number of years)";T
  49. 450   INPUT "How many times compounded per year (interest)";N
  50. 460   PRINT:INPUT "Enter for results";X$
  51. 470   CLEARW 2: PRINT "At the end of the period you will have"
  52. 480   A=P*(1+R/N)^(N*T)
  53. 490   A=INT(100*A)/100
  54. 500   PRINT "$";A
  55. 510   PRINT
  56. 520   INPUT "Do more interest calculations? (Y or N)";R$
  57. 530   IF R$="Y" OR R$="y" THEN 390
  58. 540   RETURN
  59. 550   PRINT "===ANNUITY PLANNING==="
  60. 560   PRINT "======================"
  61. 570   PRINT "In this portion you can make financial"
  62. 580   PRINT "projections of retirement income."
  63. 590   PRINT: INPUT "Enter for more---";X$
  64. 600   CLEARW 2
  65. 610   PRINT "I'll ask you how much you wish to"
  66. 620   PRINT "save or deposit each period. That is"
  67. 630   print "specify the constant amount you will"
  68. 640   PRINT "deposit each period. Then give the"
  69. 650   print "expected average high and low interest"
  70. 660   print "rates (or any two rates - percents),"
  71. 670   print "followed by the period of payments in"
  72. 680   print "years.";: print "     ";:input "More ---->";X$
  73. 690   clearw 2: print "Also give the number of payments per"
  74. 700   print "year when asked for the frequency."
  75. 710   print "Interest is assumed to be given for any"
  76. 720   print "previous balance at payment times.":print
  77. 730   input "Ready to begin? (Enter)";X$
  78. 740   clearw 2
  79. 750   input "Principal (periodic payment)";P
  80. 760   if P<0 then 750
  81. 770   input "First interest rate";I1
  82. 780   if I1<0 then 770
  83. 790   I1=I1/100
  84. 800   INPUT "Second interest rate";I2
  85. 810   if I2<0 then 800
  86. 820   I2=I2/100
  87. 830   Input "Payment frequency (number per year)";N
  88. 840   if N<0 or N<>int(N) then 830
  89. 850   input "Time in years";T
  90. 860   print
  91. 870   Input "Enter for results ---->";X$
  92. 880   clearw 2
  93. 890   print "Period  ";
  94. 900   print "Balance #1   ";"Balance #2"
  95. 910   print "=================================="
  96. 920   for DL=1 to 1000:next DL
  97. 930   S1=0: S2=0: rem 2 rates, 2 sums
  98. 940   for period=1 to N*T
  99. 950   S1=(1+I1/N)*S1+P
  100. 960   S2=(1+I2/N)*S2+P
  101. 970   S1=INT(S1*100)/100
  102. 980   S2=INT(S2*100)/100
  103. 990   PRINT "Period";period;"  ";S1,S2
  104. 1000  NEXT period
  105. 1010  print "==================================="
  106. 1020  print "Balances:   ";   INT(100*S1*(1+I1/N))/100;
  107. 1030  PRINT"       ";INT(100*S2*(1+I2/N))/100
  108. 1040  FOR DL=1 TO 1000:NEXT DL
  109. 1050  PRINT "Do more annuities (A)?"
  110. 1060  print "Or return to menu (M)?"
  111. 1070  input "Touch M or A, then Enter";N$
  112. 1080  if N$="M" or N$="m" then return
  113. 1090  if N$="A" or N$="a" then 600
  114. 1100  PRINT "===QUICK LOAN AMORTIZATION==="
  115. 1110  print "============================="
  116. 1120  print: print "Answer the questions"
  117. 1130  print "and the computer will provide your"
  118. 1140  print "monthly payment amount."
  119. 1150  print: input "More ----->";X$
  120. 1160  clearw 2
  121. 1170  input "Principal (amount borrowed)";P
  122. 1180  input "Annual interest rate (percent)";R
  123. 1190  R=R/100
  124. 1200  INPUT "Term of loan (number of years)";T
  125. 1210  print
  126. 1220  print "Your monthly payment amount is";
  127. 1230  A=P*R/(12*(1-(12/(12+R))^(12*T)))
  128. 1240  A=INT(100*A+.5)/100
  129. 1250  PRINT A
  130. 1260  PRINT: INPUT "L for more loans, M for menu";X$
  131. 1270  if X$="L" or X$="l" then 1100
  132. 1280  if X$="M" or X$="m" then return
  133. 1290  end
  134. əWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW